<!-- 
产品列表页面
 * @Author: zuobufan
 * @Location: 信息中心
 * @LastEditors: zuobufan
 * @LastEditTime: 2021-09-16 19:59:00
 -->
<template>
  <div class="products">
    <ul>
      <li v-for="item in goodsList" :key="item.id" @click="goDetails(item.id)">
        <img :src="item.list_pic_url" alt width="100%">
        <div class="van-ellipsis">{{item.name}}</div>
        <div class="price">{{item.retail_price |RMBformat}}</div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ["goodsList"],
  data() {
    return {};
  },
  created() {},
  methods: {
    goDetails(id) {
      this.$router.push("/details/?id="+id);
      window.scroll(0, 0);
      //    this.$router.push({name:"Details",params:{id:id}});
    }
  }
};
</script>
<style lang="less" scoped>
.products {
  z-index: 99;
}
ul {
  padding: 0.1rem 2%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  height: 100%;
  li {
    width: 49%;
    background-color: #fff;
    margin-bottom: 0.1rem;
    text-align: center;
    line-height: 0.3rem;
    .price {
      color: darkred;
    }
  }
}
</style>